﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using GongXianDCUI.Models;
using GongXianDCUI.DAL;

namespace GongXianDCUI.BLL
{
    public class ImgLunBoBLL
    {
        public List<LunBoPic> GetImgLunBoList(int? count = 4)
        {
            ImgLunBoDAL dal = new ImgLunBoDAL();
            List<LunBoPic> list = dal.GetLunBoImgList();
            list = list.Take(count.Value).ToList();
            for (int i = 0; i < list.Count; i++)
            {
                string titile = list[i].title;
                int len = titile.Length > 13 ? 13 : titile.Length;
                titile = titile.Substring(0, len);
                list[i].title = titile;
            }
            return list;
        }


    }
}
